package com.tanhua.model.vo;

import cn.hutool.core.bean.BeanUtil;
import com.tanhua.model.testpaper.SoulQuestions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SoulQuestionsVo implements Serializable {

    private String id; // 试题id

    private String question; // 题目

    private List<SoulOptionsVo> options = new ArrayList<>(); // 多个选项

    public static SoulQuestionsVo init(SoulQuestions questions){
        SoulQuestionsVo soulQuestionsVo = new SoulQuestionsVo();
        BeanUtil.copyProperties(questions,soulQuestionsVo);
        soulQuestionsVo.setId(questions.getId().toString());
        return soulQuestionsVo;
    }
}
